package com.timothy.android;

import com.timothy.android.util.XMLUtil;
import com.timothy.service.MessageReceiveService;
import com.timothy.service.MessageSender;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class HomeActivity extends BaseProcessActivity {
	private static final String LOG_TAG = "HomeActivity";
	private TextView console = null;
//	private Button disConnectBtn = null;
//	private Button offlineVoteBtn = null;
//	private Button multiBtn = null;
//	private Button priorityBtn = null;
//	private Button sliderBtn = null;
    
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.home);

		this.setTitle("(Address:"+MessageSender.PHONE_IP+")");
		
		//client component
		console = (TextView) this.findViewById(R.id.console);	
//		console.setTextColor(Color.BLACK);
		console.setTextSize(30);
		console.setTextColor(Color.BLACK);
		
//		console.setBackgroundColor(Color.parseColor("#ede26a"));
		console.append("Waiting Server Send Question..." + "\n");
//		console.append("If you want to enter offline vote, click button 'Offline Vote'" + "\n");
		
//		initialMockButtons();
//		initialMockAnswerButtons();
		
//		disConnectBtn = (Button) this.findViewById(R.id.disConnectBtn);
//		offlineVoteBtn = (Button) this.findViewById(R.id.offlineVoteBtn);
		
		//click end Button
//		disConnectBtn.setOnClickListener( mUnbindListener );
//		offlineVoteBtn.setOnClickListener( offlineVoteListener );
	}

	public void initialMockButtons(){		
		/*multiBtn = (Button) this.findViewById(R.id.multiBtn);
		multiBtn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent();
	        	intent.setClass(getBaseContext(), LayoutMultiSelect.class);
	        	startActivity(intent);
			}
		});
		
		priorityBtn = (Button) this.findViewById(R.id.priorityBtn);
		priorityBtn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent();
	        	intent.setClass(getBaseContext(), LayoutSort.class);
	        	startActivity(intent);
			}
		});
		
		sliderBtn = (Button) this.findViewById(R.id.sliderBtn);
		sliderBtn.setOnClickListener(new Button.OnClickListener() {
			public void onClick(View v) {
				Intent intent = new Intent();
	        	intent.setClass(getBaseContext(), LayoutSlide.class);
	        	startActivity(intent);
			}
		});*/
	}	
	public void initialMockAnswerButtons(){

	}
	
	private OnClickListener mUnbindListener = new OnClickListener() {
        public void onClick(View v) {
            doUnbindService();
        }
    }; 
    
    private OnClickListener offlineVoteListener = new OnClickListener() {
        public void onClick(View v) {
        	Intent intent = new Intent();
        	intent.setClass(getBaseContext(), OfflineQuestionsActivity.class);
        	startActivity(intent);
        }
    };

		 

}
